package io;

import java.io.Serializable;
import java.util.Arrays;

public class Person implements Serializable {
    private static final long serialVersionUID = 258354357300352267L;   // Serializable:告诉这个类需要序列化




    private String name;
    private int age;
    private  String gender;
    //private String[] otherInfo;
    private transient String[] otherInfo;


    public Person(String name, int age, String gender, String[] otherInfo) {
        this.name = name;
        this.age = age;
        this.gender = gender;
        this.otherInfo = otherInfo;
    }

    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", gender='" + gender + '\'' +
                ", otherInfo=" + Arrays.toString(otherInfo) +
                '}';
    }
}

